<template>
  <div id="contentBox">
    <div class="searchBox">
      <el-form :inline="true" ref="searchForm" :model="searchForm" label-width="96px">
        <el-form-item label="申请日期起" prop="startDate">
          <el-date-picker :editable="false" @change="debounceSeach" v-model="searchForm.startDate" type="date" placeholder="选择日期" :picker-options="startDateOpt">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="申请日期止" prop="endDate">
          <el-date-picker :editable="false" @change="debounceSeach" v-model="searchForm.endDate" type="date" placeholder="选择日期" :picker-options="endDateOpt">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="订单号" prop="orderNumber">
          <el-input v-model="searchForm.orderNumber" placeholder="请输入搜索内容..." @input.native="debounceSeach"></el-input>
        </el-form-item>
        <el-form-item label="融资经销商" prop="dealerName">
          <el-input v-model="searchForm.dealerName" placeholder="请输入搜索内容..." @input.native="debounceSeach">
          </el-input>
        </el-form-item>

        <el-form-item label="订单状态" prop="carOrderStatus">
          <el-select v-model="searchForm.carOrderStatus" placeholder="请选择"  @change="debounceSeach">
             <el-option label="全部" value=""></el-option>
            <el-option v-for="(item,index) in carOrderStatus" :key="item" :label="item" :value="index">
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="第一期服务费状态" prop='isSettle'>
          <el-select v-model="searchForm.isSettle" placeholder="请选择"  @change="debounceSeach">
             <el-option label="全部" value=""></el-option>            
            <el-option v-for="(item,index) in isSettle" :key="item" :label='item' :value="index">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="是否延期" prop='isDelay'>
          <el-select v-model="searchForm.isDelay" placeholder="请选择"  @change="debounceSeach">
             <el-option label="全部" value=""></el-option>            
            <el-option v-for="(item,index) in isDelay" :key="item" :label='index' :value="item">
            </el-option>
          </el-select>
        </el-form-item>


        <el-form-item style="margin-bottom: 10px;">
          <el-button  type="primary" @click="resetSearchForm('searchForm')">重置</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div id="tableBox" style="margin:0 25px;">
      <el-table :data="tableData.data" border>
        <el-table-column label="订单号" width="140" fixed>
          <template scope="scope">
            <span>{{ scope.row.orderNumber }}</span>
          </template>
        </el-table-column>
        <el-table-column label="融资经销商" min-width="240">
          <template scope="scope">
            <span>{{ scope.row.dealerName }}</span>
          </template>
        </el-table-column>
        <el-table-column label=" 融资总金额(元) " :min-width="300">
          <template scope="scope">
            <span>{{ scope.row.mortgageSumMoney| toFixed2 }}</span>
          </template>
        </el-table-column>
        <el-table-column label=" 订单状态 " width="120">
          <template scope="scope">
            <span>{{ scope.row.statusString }}</span>
          </template>
        </el-table-column>
        <el-table-column label="第一期服务费状态" width="120">
          <template scope="scope">
            <span>{{ scope.row.isSettle}}</span>
          </template>
        </el-table-column>
        <el-table-column label=" 是否延期" width="120">
          <template scope="scope">
            <span>{{ scope.row.isDelay}}</span>
          </template>
        </el-table-column>
        <el-table-column label="申请时间" width="180">
          <template scope="scope">
            <span>{{getDate(scope.row.addTime) }}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作" width="140" fixed="right">
          <template scope="scope">
            <el-button size="small" type="primary" @click='handleSee($event)' :data-carOrderId='scope.row.carOrderId'	v-if="(scope.row.isSettle=='已结清'&&scope.row.statusString!=='库融已结清')&&scope.row.isDelay=='未申请延期'">延期</el-button>
            <el-button size="small" type="success" @click='handleSee($event)' :data-carOrderId='scope.row.carOrderId' v-if='scope.row.status==10090||scope.row.status==10100'>添加</el-button>
            <el-button size="small" type="info" @click='handleSee($event)' :data-carOrderId='scope.row.carOrderId'>查看</el-button>
          </template>
        </el-table-column>
      </el-table>

      <el-dialog title=" 库融回款单管理"  v-if="childCode==='延期'" :visible.sync="dialogSendData.dialogFormVisible" :lock-scroll='true'
        top=5% :close-on-click-modal="false">
            <PostponeBill v-if="dialogSendData.dialogFormVisible" @Refresh="seachData()"  :carorderId='carorderId'  :dialogSendData='dialogSendData'></PostponeBill>
      </el-dialog>

      <el-dialog title=" 回款单管理"  v-if="childCode==='添加'||childCode==='child查看'" :visible.sync="dialogSendData.dialogFormVisible" :lock-scroll='true'
        top=5% :close-on-click-modal="false">
            <AddGathering v-if="dialogSendData.dialogFormVisible"  :carorderId='carorderId' :dialogSendData='dialogSendData' :id='id' :childCode='childCode' @Refresh="seachData()" ></AddGathering>
      </el-dialog>

      <el-dialog title=" 库融回款单列表"  v-if="childCode==='查看'" :visible.sync="dialogSendData.dialogFormVisible" :lock-scroll='true'
        top=5% :close-on-click-modal="false">
            <GatheringDetail v-if="dialogSendData.dialogFormVisible" :dialogSendData='dialogSendData' :carorderId='carorderId' :childCode='childCode' @look='emitButton'></GatheringDetail>
      </el-dialog>

    </div>
    <div class="block" style="text-align: center;margin-top: 15px;">
           <pagination v-on:refreshSeachData="seachData()"  :tableData="tableData" :searchForm="searchForm"></pagination>
    </div>
  </div>


</template>
<script src="./index.js">


</script>

